home *** CD-ROM | disk | FTP | other *** search
- <?php if (!defined("SOexcelu")) { define("SOExcelu", 1);
-
- include("SOhttp.php");
-
- // Update cell inside an Excel spreadsheet.
- // Inputs:
- // $sAddr: address of BadBlue server (e.g., "127.0.0.1:8080")
- // $sPath: path of shared file in EXT.INI file (e.g., "path3")
- // $sFile: name of Excel file to examine (e.g., "invoice.xls")
- // $nSheet: sheet number (e.g., 1)
- // $sUpdateCell: cell of area to retrieve (e.g., "A1")
- // $sUpdateValue: value to update cell (always passed in as a string)
- // $sUpdateType: data type of cell being updated (default is "S")
- // I2 = short-int I4 = long int R4 = real R8 = float
- // C = currency D = date B = boolean E = empty
- // S = string
- // $sUser: (optional) user-name to get access to file
- // $sPassword: (optional) password to get access to file
- // Outputs:
- // $errmsg: empty if no error occurred, otherwise error message
- //
- function SOExcelUpdate($sAddr, $sPath, $sFile, $nSheet,
- $sUpdateCell, $sUpdateValue, $sUpdateType,
- $sUser = "", $sPassword = "") {
- $errmsg = "";
- do {
-
- // Construct URL and grab page...
- //
- $nX = $nY = 1; $nDX = $nDY = 10;
- $sURL = "http://".$sAddr."/ext.dll?MfcISAPICommand=LoadPage&".
- "page=xls.htx&a0=/get/".$sPath."/".rawurlencode($sFile)."&a1=".$nSheet."&a2=Update&".
- "a3=".$nX."&a4=".$nY."&a5=".$nDX."&a6=".$nDY."&a7=2&a8=100%25&".
- "a10=".$sUpdateCell."&a9=".rawurlencode($sUpdateValue)."/".$sUpdateType;
- // echo("URL = $sURL <BR>");
- $errmsg = SOHTTPGet($sURL, &$sPage, $sUser, $sPassword);
- if (strlen($errmsg)) {
- break;
- }
-
- } while (0);
- return ($errmsg);
- }
-
- } ?>
-